﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace ConsoleApp
{
    public static class CommToolHelper
    {
        /// <summary>
        /// 替换中文字符
        /// </summary>
        /// <param name="src"></param>
        /// <returns></returns>
        public static string replaceChineseCharactersWithEmpty(string src)
        {
            if (null != src)
            {
                src = Regex.Replace(src, @"[\u4e00-\u9fa5]", "");
            }
            return src;
        }
        /// <summary>
        /// 替换大小写字母
        /// </summary>
        /// <param name="src"></param>
        /// <returns></returns>
        public static string replaceLettersWithEmpty(string src)
        {

            if (null != src)
            {
                src = Regex.Replace(src, "[A-Za-z ]", "");
            }
            return src;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="src"></param>
        /// <returns></returns>
        public static string replaceBracketsWithEmpty(string src)
        {
            if (null != src)
            {
                src = src.Replace("(", "").Replace(")", "").Replace("（", "").Replace("）","");
            }
            return src;
        }
    }
}
